class AddIndex < ActiveRecord::Migration
  def self.up
    add_index :segments,:data
    add_index :segments,:size
    add_index :segments,:surface
    add_index :segments,:reading
    add_index :segments,:pronunciation
    add_index :segments,:basetype_surface
    add_index :segments,:basetype_reading
    add_index :segments,:basetype_pronunciation

    add_index :corpora_segments,:segment_id
    add_index :corpora_segments,:corpus_id
    add_index :corpora_segments,[:corpus_id,:segment_id],:name => :corpora_segments_full_index

  end

  def self.down
    remove_index :segments,:data
    remove_index :segments,:size
    remove_index :segments,:surface
    remove_index :segments,:reading
    remove_index :segments,:pronunciation
    remove_index :segments,:basetype_surface
    remove_index :segments,:basetype_reading
    remove_index :segments,:basetype_pronunciation

    remove_index :corpora_segments,:segment_id
    remove_index :corpora_segments,:corpus_id
    remove_index :corpora_segments,:name => :corpora_segments_full_index
  end
end
